
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
tslint-plugin-prettier
Advanced tools
Runs Prettier as a TSLint rule and reports differences as individual TSLint issues.
Runs Prettier as a TSLint rule and reports differences as individual TSLint issues.
a();;;
~~
;;;
~~~ [Delete `;;⏎;;;`]
var foo = ''
~~ [Replace `''` with `"";⏎`]
var foo= "";
~ [Insert `·`]
# using npm
npm install --save-dev tslint-plugin-prettier prettier
# using yarn
yarn add --dev tslint-plugin-prettier prettier
(require prettier@^1.9.0
)
(tslint.json)
for tslint@^5.2.0
{
"rulesDirectory": ["tslint-plugin-prettier"],
"rules": {
"prettier": true
}
}
for tslint@^5.0.0
{
"extends": ["tslint-plugin-prettier"],
"rules": {
"prettier": true
}
}
NOTE: To use this plugin, it'd better to also use tslint-config-prettier to disable all prettier-related rules, so as to avoid conflicts between existed rules.
If there is no option provided, it'll try to load config file and/or .editorconfig
if possible, uses Prettier's default option if not found.
{
"extends": ["tslint-plugin-prettier"],
"rules": {
"prettier": true
}
}
If you don't want to load .editorconfig
, disable it in the third argument.
{
"extends": ["tslint-plugin-prettier"],
"rules": {
"prettier": [true, null, { "editorconfig": false }]
}
}
If you'd like to specify which config file to use, just put its path (relative to process.cwd()
) in the second argument, the following example shows how to load the config file from <cwd>/configs/.prettierrc
:
{
"extends": ["tslint-plugin-prettier"],
"rules": {
"prettier": [true, "configs/.prettierrc"]
}
}
If you'd like to specify options manually, just put Prettier Options in the second argument, for example:
{
"extends": ["tslint-plugin-prettier"],
"rules": {
"prettier": [true, { "singleQuote": true }]
}
}
It will respect your .prettierignore file in your project root ( process.cwd() ) but if you would like to use a different file you can provide it in the third argument, for example:
{
"extends": ["tslint-plugin-prettier"],
"rules": {
"prettier": [true, null, { "ignorePath": "otherDirectory/.prettierignore" }]
}
}
# lint
yarn run lint
# build
yarn run build
# test
yarn run test
MIT © Ika
FAQs
Runs Prettier as a TSLint rule and reports differences as individual TSLint issues.
We found that tslint-plugin-prettier demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.